package com.wechat.apidoc;

import com.wechat.utils.ActionResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.catalina.servlet4preview.http.HttpServletRequest;

import java.math.BigDecimal;

/**
 * Created by ycx on 2018/4/11.
 */
@Api(description = "出题接口文档")
public interface WxQuestionInterface {

    @ApiOperation(value = "初始化出题记录", notes = "" +
            "\"data\": {\n" +
            "    \"id\": \"问题id\",\n" +
            "  };"
    )
    @ApiImplicitParams({
            @ApiImplicitParam(name = "key", value = "用户秘钥", paramType = "query", required = true, dataType = "String")
    })
    ActionResult saveQuestion(String key);

    @ApiOperation(value = "提交出题任务")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "问题id", paramType = "query", required = true, dataType = "int"),
            @ApiImplicitParam(name = "key", value = "用户秘钥", paramType = "query", required = true, dataType = "String")
    })
    ActionResult commitQuestion(Integer id, String key);

    @ApiOperation(value = "查询出题记录总记录", notes = "" +
            "\"data\": {\n" +
            "    \"id\": \"问题id\",\n" +
            "    \"totalAmount\": \"红包金额\",\n" +
            "    \"totalNumber\": \"红包数量\",\n" +
            "    \"totalRight\": \"答对几题可抢\",\n" +
            "  };\n" +
            "\"user\":{\n" +
            "    \"nickname\":\"用户昵称\",\n" +
            "    \"avatarUrl\":\"用户头像\",\n" +
            "  };"
    )
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "问题id", paramType = "query", required = true, dataType = "int"),
            @ApiImplicitParam(name = "key", value = "用户秘钥", paramType = "query", required = true, dataType = "String")
    })
    ActionResult selQuestion(Integer id, String key);

    @ApiOperation(value = "提交出题记录答案", notes = "" +
            "\"data\":{\n" +
            "    \"questionNum\":\"已经出了多少题\",\n" +
            "  };"
    )
    @ApiImplicitParams({
            @ApiImplicitParam(name = "questionId", value = "问题id", paramType = "query", required = true, dataType = "int"),
            @ApiImplicitParam(name = "questionLibId", value = "题库题目id", paramType = "query", required = true, dataType = "int"),
            @ApiImplicitParam(name = "trueAnswer", value = "正确答案", paramType = "query", required = true, dataType = "String"),
            @ApiImplicitParam(name = "key", value = "用户秘钥", paramType = "query", required = true, dataType = "String")
    })
    ActionResult saveQuestionDetail(Integer questionId, Integer questionLibId, String trueAnswer, String key);

    @ApiOperation(value = "随机从题库查询出一条与之前不重复的题目", notes = "" +
            "\"data\": {\n" +
            "    \"id\": \"题库题目id\",\n" +
            "    \"question\": \"试题题目\",\n" +
            "    \"answers_a\": \"备选答案A\",\n" +
            "    \"answers_b\": \"备选答案B\",\n" +
            "    \"answers_c\": \"备选答案C\",\n" +
            "    \"answers_d\": \"备选答案D\",\n" +
            "  };"
    )
    @ApiImplicitParams({
            @ApiImplicitParam(name = "questionId", value = "出题记录编号", paramType = "query", required = true, dataType = "int"),
            @ApiImplicitParam(name = "key", value = "用户秘钥", paramType = "query", required = true, dataType = "String")
    })
    ActionResult selNotRepeatQuestion(Integer questionId, String key);

    @ApiOperation(value = "设置红包", notes = "" +
            "\"data\": {\n" +
            "    \"timeStamp\": \"timeStamp\",\n" +
            "    \"nonceStr\": \"nonceStr\",\n" +
            "    \"package\": \"package\",\n" +
            "    \"signType\": \"MD5\",\n" +
            "    \"paySign\": \"paySign\",\n" +
            "  };"
    )
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "问题id", paramType = "query", required = true, dataType = "int"),
            @ApiImplicitParam(name = "totalAmount", value = "红包总金额", paramType = "query", required = true, dataType = "double"),
            @ApiImplicitParam(name = "totalNumber", value = "红包总数", paramType = "query", required = true, dataType = "int"),
            @ApiImplicitParam(name = "totalRight", value = "答对几题可抢", paramType = "query", required = true, dataType = "int"),
            @ApiImplicitParam(name = "key", value = "用户秘钥", paramType = "query", required = true, dataType = "String")
    })
    ActionResult setRedPacket(Integer id, BigDecimal totalAmount, Short totalNumber, Short totalRight, String key, HttpServletRequest request);
}





































